import {createSlice,} from '@reduxjs/toolkit';

 const countSlice =  createSlice({
    name : "count",
    initialState :{
        count: 0,
    },
    reducers:{
        increment(preState,action){
            
            preState.count += action.payload
        },
        decrement(preState,action){
            preState.count -= action.payload
        }
    }
})

export default countSlice.reducer;
export const {
    increment,
    decrement
} = countSlice.actions